/* 
 * File:   vector.hpp
 * Author: gian
 *
 * Created on April 17, 2012, 10:10 AM
 */

#ifndef VECTOR_HPP
#define	VECTOR_HPP

#include <gsl/gsl_vector.h>

class vector {
public:
    /**
     * Constructor
     * @param n the size of the vector
     */
    vector(unsigned int n);
    /**
     * Copy constructor
     * @param orig reference to a vector istance
     */
    vector(const vector& orig);
    /**
     * Destructor
     */
    virtual ~vector();
    /**
     * Change the size of the vector. Data are not preserved.
     * @param n the new size of the vector
     */
    void resize(unsigned int n);
    /**
     * Get a vector element
     * @param i the index of the element
     * @return the value of the element
     */
    double get(size_t i) const;
    /**
     * Set a vector element
     * @param i the index of the element
     * @param v the new value of the element
     */
    void set(size_t i, double v);
    /**
     * Get the size of the vector
     * @return the size of the vector
     */
    size_t size() const;
    /**
     * Pointer to a gsl_vector istance
     */
    gsl_vector *v;
private:
};

class cvector {
public:
    /**
     * Constructor
     * @param n the size of the vector
     */
    cvector(unsigned int n);
    /**
     * Copy constructor
     * @param orig reference to a vector istance
     */
    cvector(const cvector& orig);
    /**
     * Destructor
     */
    virtual ~cvector();
    /**
     * Change the size of the vector. Data are not preserved.
     * @param n the new size of the vector
     */
    void resize(unsigned int n);
    /**
     * Get a vector element
     * @param i the index of the element
     * @return the value of the element
     */
    gsl_complex get(size_t i) const;
    /**
     * Set a vector element
     * @param i the index of the element
     * @param v the new value of the element
     */
    void set(size_t i, double re, double im);
    /**
     * Get the size of the vector
     * @return the size of the vector
     */
    size_t size() const;
    /**
     * Pointer to a gsl_vector istance
     */
    gsl_vector_complex *v;
private:
};

class vectorf {
public:
    /**
     * Constructor
     * @param n the size of the vector
     */
    vectorf(unsigned int n);
    /**
     * Copy constructor
     * @param orig reference to a vector istance
     */
    vectorf(const vectorf& orig);
    /**
     * Destructor
     */
    virtual ~vectorf();
    /**
     * Change the size of the vector. Data are not preserved.
     * @param n the new size of the vector
     */
    void resize(unsigned int n);
    /**
     * Get a vector element
     * @param i the index of the element
     * @return the value of the element
     */
    float get(size_t i) const;
    /**
     * Set a vector element
     * @param i the index of the element
     * @param v the new value of the element
     */
    void set(size_t i, float v);
    /**
     * Get the size of the vector
     * @return the size of the vector
     */
    size_t size() const;
    /**
     * Pointer to a gsl_vector istance
     */
    gsl_vector_float *v;
private:
};

class cvectorf {
public:
    /**
     * Constructor
     * @param n the size of the vector
     */
    cvectorf(unsigned int n);
    /**
     * Copy constructor
     * @param orig reference to a vector istance
     */
    cvectorf(const cvectorf& orig);
    /**
     * Destructor
     */
    virtual ~cvectorf();
    /**
     * Change the size of the vector. Data are not preserved.
     * @param n the new size of the vector
     */
    void resize(unsigned int n);
    /**
     * Get a vector element
     * @param i the index of the element
     * @return the value of the element
     */
    gsl_complex_float get(size_t i) const;
    /**
     * Set a vector element
     * @param i the index of the element
     * @param v the new value of the element
     */
    void set(size_t i, float re, float im);
    /**
     * Get the size of the vector
     * @return the size of the vector
     */
    size_t size() const;
    /**
     * Pointer to a gsl_vector istance
     */
    gsl_vector_complex_float *v;
private:
};


#endif	/* VECTOR_HPP */

